﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="UserService.aspx.cs" Inherits="kehuguanli.UserService" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title></title>
        <script type="text/javascript" src="ymPrompt.js"></script>
    <script type ="text/javascript">
        $(".GetMes").click(function () {
            //如果己为Id属性指定用户Id，则可以查看详细
            if ($.trim($(this).attr("id")).length > 0) {
                //使用ymPrompt组件显示一个弹出式窗口，链接到特定页面 
                ymPrompt.win({
                    message: "GetMoreMes.aspx?UID=" + $(this).attr("id"),
                    width: 710, height: 560, title: '客户详细信息',
                    handler: null, maxBtn: false, minBtn: false, iframe: true
                });
            }
        })
        $("#BtnAllSelect").click(function () {
            if ($("#BtnAllSelect").val() == "全选") {
                $("#BtnAllSelect").val("反选");
                //选中所有的记录，设置其checked属性为true
                $("[name=CheckMes]:checkbox").attr("checked", true);
            }
            else {
                $("#BtnAllSelect").val("全选"); //将按钮文本设为全选
                //循环找到的元素，设置其checked属性
                $("[name=CheckMes]:checkbox").each(function () {
                    this.checked = !this.checked;
                })
            }
        });
        $("#BtnAllDel").click(function () {
            //弹出提示消息
            if (confirm("你确定删除所有选中的信息？")) {
                var checkValue = "";
                //查找所有的己选中的checkbox，将值以逗号分隔
                $("[name=CheckMes]:checkbox:checked").each(function () {
                    if ($.trim($(this).val()).length > 0) {
                        checkValue += "," + $.trim($(this).val());
                    }
                })
                //如果未选任何记录，则弹出消息并返回
                if (checkValue.length == 0) {
                    alert("你没有选择任何信息，请先选中要删除的信息！");
                    return false;
                }
                else {
                    //否则保存到页面上的HiddenField中去
                    $("#HSelectID").val(checkValue.substr(1));
                }
                return true;
            }
            else {
                return false;
            }
        });

    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    
        <asp:Repeater ID="Repeater1" runat="server" OnItemCommand="Repeater1_ItemCommand">
             <HeaderTemplate>
                <table cellpadding="3" 
                cellspacing="1" class="Admin_Table">
                    <thead>
                        <tr class="Admin_Table_Title">
                            <th style="width: 10%;">
                                操作
                            </th>
                            <th style="width: 7%;">
                                类型
                            </th>
                            <th style="width: 8%;">
                                等级
                            </th>
                            <th style="width: 15%;">
                                状态
                            </th>
                            <th style="width: 15%;">
                                客户名
                            </th>
                            <th style="width: 35%;">
                                企业名称
                            </th>
                            <th style="width: 13%;">
                                录入时间
                            </th>
                        </tr>
                    </thead>
            </HeaderTemplate>
            <ItemTemplate>
                <tr>
                    <td>
                        <input type="checkbox" value='<%#Eval("T_UserID") %>' 
                        name="CheckMes" />&nbsp;
                        <a title="查看详细信息.." 
                        href="#" id='<%#Eval("T_UserID") %>' class="GetMes">
                        <img src="Images/LookMes.gif"/></a>
                    </td>
                    <td>
                        <%# kehuguanli.Commons.UserType(Eval("T_UserType"))%>
                    </td>
                    <td>
                        <%#kehuguanli.Commons.UserLeave(Eval("T_UserLeave"))%>
                    </td>
                    <td>
                        <%#kehuguanli.Commons.UserState(Eval("T_UserState"), 
                        Eval("T_NowService"))%>
                    </td>
                    <td>
                        <%#kehuguanli.Commons.NullString(Eval("T_Person"))%>
                    </td>
                    <td>
                        <%#kehuguanli.Commons.NullString(Eval("T_CompanyName"))%>
                    </td>
                    <td>
                        <%#Eval("T_DateTime","{0:yyyy-MM-dd}")%>
                    </td>
                </tr>
            </ItemTemplate>
            <FooterTemplate>
            </table>
            </FooterTemplate>
        </asp:Repeater>
     <div class="BottomPage">
            <span class="LeftCommon">
                <input id="BtnAllSelect" type="button" value="全选" />&nbsp;
                <asp:Button ID="BtnAllDel" runat="server" Text="删除" 
                OnClick="BtnAllDel_Click" />
            </span> 
                   
        </div>
    </div>
    </form>
</body>
</html>
